<template>
    <div>
        <el-table
            :data="label_list"
            style="width: 100%">
                <el-table-column
                    prop="label_id"
                    label="标签ID"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="goods_type"
                    label="货物类型"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="create_user"
                    label="创建人"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="use_user"
                    label="使用人">
                </el-table-column>
                <el-table-column
                    prop="create_time"
                    label="创建时间">
                </el-table-column>
                <el-table-column
                    prop="modify_time"
                    label="更新时间">
                </el-table-column>
                <el-table-column
                fixed="right"
                label="操作"
                width="100">
                <template slot-scope="scope">
                    <el-button
                    size="mini"
                    @click="handleEdit(scope.$index, scope.row)">编辑</el-button><br>
                    <el-button
                    size="mini"
                    type="danger"
                    @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                </template>
                </el-table-column>
            </el-table>
    </div>
</template>

<script>
import {get_tags_list_get} from './axios_api/api.js'
export default {
    data() {
        return {
            label_list: [],
        }
    },
    mounted() {
        this.get_tags_list()
    },
    methods: {
        handleEdit(index, row) {
            console.log(index, row);
        },
        handleDelete(index, row) {
            console.log(index, row);
            row.is_delete = 2
        },
        get_tags_list() {
            get_tags_list_get().then(res => {
                this.label_list = res.label_list
            })
        },
    }
}
</script>